<!DOCTYPE html>
<html lang="ch-ZH">
<head>
    <#include "/plugin.ftl" >
    <link rel="stylesheet" href="${springMacroRequestContext.contextPath}/plugin/ztree/zTreeStyle.css" type="text/css">
    <script type="text/javascript" src="${springMacroRequestContext.contextPath}/plugin/ztree/jquery.ztree.all.min.js"></script>

    <title>系统资源管理</title>
</head>
<body>
<div class="container-fluid">
    <div class="row bg-info">
        <div class="col-md-12">
            <h5 class="">系统设置 &gt; 认证管理 &gt; 资源管理</h5>
        </div>
    </div>
    <div id="alertbar" class="col-md-12">
        <div class="alert alert-warning col-md-4 col-md-offset-4" role="alert" style="display: none">
            <button type="button" class="close"><span aria-hidden="true">&times;</span></button>
            <strong class="title">提示：</strong>
            <span class="content">操作成功。</span>
        </div>
    </div>
    <div class="" style="position: relative;">
        <div id="treebar" style="position: absolute;left:0;width:260px;max-height:720px;overflow-y: auto">
            <h4>系统菜单</h4>
            <ul id="permissiontree" class="ztree" style="max-width: 98%;overflow-y: auto;"></ul>
        </div>
        <div style="position: absolute;left:262px;right: 10px;">
            <div id="listbar" class="row" style="margin-top:10px;">
                <div class="col-md-12">
                    <button type="button" class="btn btn-primary add">创建新资源</button>
                    <button type="button" class="btn btn-danger del">批量删除</button>
                </div>
            </div>
            <div id="tablebar" class="row" style="margin-top:4px;">
                <div class="col-md-12">
                    <form id="formbar" class="form-inline">
                        <div class="form-group">
                            <label for="tablebar_pid">PID</label>
                            <input type="number" class="form-control" style="width: 82px;" id="tablebar_pid" name="pid"
                                   readonly>
                        </div>
                        <div class="form-group">
                            <label for="name">资源名</label>
                            <input type="text" class="form-control" id="name" name="name">
                        </div>
                        <div class="form-group">
                            <label for="type">类型</label>
                            <select class="form-control" id="type" name="type" style="width: 150px;">
                                <option value="">资源类型...</option>
                            </select>
                        </div>
                        <!--<div class="form-group">
                          <label for="endDate">有效期</label>
                          <input type="text" class="form-control" id="startDate" name="startDate" style="width:100px;" readonly>
                          <span> - </span>
                          <input type="text" class="form-control" id="endDate" name="endDate" style="width:100px;" readonly>
                        </div>-->
                        <button type="button" class="btn btn-primary margin-left-20" name="refresh"
                                onclick="$('#table').bootstrapTable('refresh');">查询
                        </button>
                        <button type="button" class="btn btn-info margin-left-20"
                                onclick="document.getElementById('formbar').reset();">重置
                        </button>
                    </form>
                    <table id="table" class="table table-hover table-bordered"></table>
                </div>
            </div>
        </div>
    </div>

</div> <!-- /.container-fluid -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel">
    <div class="modal-dialog" style="width: 880px;height:760px;">
        <div class="modal-content">
            <div class="modal-header">
                <button data-dismiss="modal" class="close" type="button"><span aria-hidden="true">×</span><span
                        class="sr-only">Close</span></button>
                <h4 class="modal-title">创建新资源</h4>
            </div>
            <div class="modal-body">
                <form id="addForm" class="form-horizontal" action="${dir}/add" method="POST">
                    <div class="row">
                        <div class="form-group col-sm-6">
                            <label class="col-sm-3 control-label">PID</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="pid" placeholder="父级资源ID">
                            </div>
                        </div>
                        <div class="form-group col-sm-6">
                            <label class="col-sm-3 control-label">类型</label>
                            <div class="col-sm-9">
                                <select class="form-control" name="type">
                                    <option value="0">静态资源</option>
                                    <option value="1">目录</option>
                                    <option value="2">菜单</option>
                                    <option value="3">接口</option>

                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group col-sm-6">
                            <label class="col-sm-3 control-label">资源名</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="name" placeholder="">
                            </div>
                        </div>
                        <div class="form-group col-sm-6">
                            <label class="col-sm-3 control-label">权限码</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="shiro" placeholder="请设置shiro权限码">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group col-sm-6">
                            <label  class="col-sm-3 control-label">图标</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="icon" placeholder="请输入图标样式名称">
                            </div>
                        </div>
                        <div class="form-group col-sm-6">
                            <label class="col-sm-3 control-label">排序</label>
                            <div class="col-sm-9">
                                <input type="number" class="form-control" name="sorting" placeholder="排序，默认降序">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group col-sm-10">
                            <label class="col-sm-2 control-label">URL</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="url" placeholder="资源访问地址，目录不填">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group col-sm-10">
                            <label class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-10">
                                <textarea class="form-control" name="description" placeholder="" rows="3"
                                          style="resize:none"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <div class="col-sm-offset-9 col-sm-3">
                                <button data-dismiss="modal" class="btn btn-default" type="button">关闭</button>
                                <button class="btn btn-primary" type="submit">提交</button>
                                <input type="hidden" name="id" value=""/>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
<div id="viewModal" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog" style="width: 880px; height: 760px;">
        <div class="modal-content">
            <div class="modal-header">
                <button data-dismiss="modal" class="close" type="button">
                    <span aria-hidden="true">×</span><span class="sr-only">Close</span>
                </button>
                <h3 class="modal-title">查看资源详情</h3>
            </div>
            <div class="modal-body">
                <table class="table table-bordered">
                    <tbody>
                    <tr>
                        <th scope="row" class="col-sm-2">PID</th>
                        <td id="view_pid" class="col-sm-4"></td>
                        <th class="col-sm-2" >类型</th>
                        <td id="view_type"></td>
                    </tr>
                    <tr>
                        <th scope="row" class="col-sm-2">名称</th>
                        <td id="view_name" class="col-sm-4"></td>
                        <th class="col-sm-2" >权限码</th>
                        <td id="view_shiro"></td>
                    </tr>
                    <tr>
                        <th scope="row" class="col-sm-2">图标</th>
                        <td id="view_icon" class="col-sm-4"></td>
                        <th class="col-sm-2" >排序</th>
                        <td id="view_sorting"></td>
                    </tr>
                    <tr>
                        <th scope="row">访问URL</th>
                        <td id="view_url" colspan="3"></td>
                    </tr>
                    <tr>
                        <th scope="row">创建时间</th>
                        <td id="view_createTime"></td>
                        <th scope="row">修改时间</th>
                        <td id="view_updateTime"></td>
                    </tr>
                    <tr>
                        <th scope="row">备注</th>
                        <td id="view_description" colspan="3"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!-- /.view model -->
<div id="deleteModal" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button data-dismiss="modal" class="close" type="button"><span aria-hidden="true">×</span><span
                        class="sr-only">Close</span></button>
                <h5 class="modal-title">数据删除确认</h5>
            </div>
            <div class="modal-body">确认删除选的数据吗？<br>删除后无法恢复！</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-danger del">确认删除</button>
            </div>
        </div>
    </div>
</div>
<#include "/dir.ftl"/>
<script type="text/javascript" src="${springMacroRequestContext.contextPath}/asset/system/auth/permissionlist.js?v=${js_version}1"></script>
</body>
</html>
